Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix loading bug on anomalies live chart #129

Merged
merged 2 commits into from
May 11, 2020

Conversation

ohltyler
Copy link
Contributor

@ohltyler ohltyler commented May 11, 2020

Issue #, if available:

Description of changes:

Adds error checking to anomalies live chart in the case that .opendistro-anomaly-results index does not exist yet. Without error checking, chart was getting stuck in an infinite loading state. This fixes that.

Before:

Screen Shot 2020-05-11 at 10 52 28 AM

After:

Screen Shot 2020-05-11 at 10 51 59 AM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

true
);
// need to initially check if there is an error when accessing anomaly results index
// in the case that it doesn't exist upon cluster initialization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Can you help check if other places have similar issue? Like detector list page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked - detector list page doesn't ping anomaly results idx

dispatch,
-1,
1,
true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if you change this to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't that change the functionality of the call? I think we just want to encapsulate any error here (which can definitely be caused by the index not existing yet) and set is loading to false.

@ohltyler ohltyler merged commit 7f60a09 into opendistro-for-elasticsearch:master May 11, 2020
ohltyler added a commit that referenced this pull request May 11, 2020
* Fix loading bug on live anomalies chart
Copy link
Contributor

@yizheliu-amazon yizheliu-amazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also want to include the call at line 119 into the try catch

ohltyler added a commit that referenced this pull request May 11, 2020
* Fix loading bug on live anomalies chart
@ohltyler ohltyler deleted the fixLoadingBug branch May 11, 2020 22:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants